using UnityEngine;
using System.Collections;

public class Projectile : MonoBehaviour 
{
	public float speed = 15.0f;
	
	private Transform _transform;
	
	void Start()
	{
		_transform = transform;
	}
	
	// Update is called once per frame
	void Update () 
	{
		_transform.Translate(new Vector3(0.0f, speed*Time.deltaTime, 0.0f));
		
		if(_transform.position.y > 6f || _transform.position.y < -6f)
		{
			Destroy(gameObject); //Destroy itself
		}
	}
}
